import request from '@/utils/request'

// 查询付款单列表
export function listPaymentSlips(query) {
  return request({
    url: '/finance/PaymentSlips/list',
    method: 'get',
    params: query
  })
}

// 查询付款单详细
export function getPaymentSlips(paymentId) {
  return request({
    url: '/finance/PaymentSlips/' + paymentId,
    method: 'get'
  })
}

// 新增付款单
export function addPaymentSlips(data) {
  return request({
    url: '/finance/PaymentSlips',
    method: 'post',
    data: data
  })
}

// 修改付款单
export function updatePaymentSlips(data) {
  return request({
    url: '/finance/PaymentSlips',
    method: 'put',
    data: data
  })
}

// 删除付款单
export function delPaymentSlips(paymentId) {
  return request({
    url: '/finance/PaymentSlips/' + paymentId,
    method: 'delete'
  })
}

// 核准功能
export function getUpdatePaymentApplicant(paymentId, flay) {
  return request({
    url: '/finance/PaymentSlips/updatePaymentApplicant/' + paymentId + "/" + flay,
    method: 'put'
  })
}

//根据paymentId来查询数据
export function getSelectPaymentApplicantByPaymentId(paymentId) {
  return request({
    url: '/finance/PaymentSlips/selectPaymentApplicantByPaymentId/' + paymentId,
    method: 'get'
  })
}

//过账
export function getUpdatePostingApplicant(paymentId) {
  return request({
    url: '/finance/PaymentSlips/updatePostingApplicant/' + paymentId,
    method: 'put'
  })
}
